package com.wavehi.interceptor.cogfig;

import com.wavehi.interceptor.web.inteceptor.MyInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author WaveHi
 * @Date 13/11/2021 下午 3:10
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description
 */
@Configuration
public class MyConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login")
                .excludePathPatterns("/toLogin");
    }
}
